package com.example.jdk14;

import java.io.Serializable;

public record RecordTest(int id, String name, int age) implements Serializable {
    public RecordTest(int id) {
        this(id, null, 0);
    }

    public RecordTest(int id, String name) {
        this(id, name, 0);
    }

    public RecordTest(String name, int age) {
        this(0, name, age);
    }

    @Override
    public int id() {
        return id;
    }

    @Override
    public String name() {
        return name;
    }

    @Override
    public int age() {
        return age;
    }

    @Override
    public String toString() {
        return "RecordTest{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
